package com.sunmnet.auto.spring.mvc.temp;

import com.sunmnet.auto.spring.mvc.ASMConfig;

public enum FileType implements IfType {
	
	CONTROLLER {
		 public String getClassPath() {
			return ASMConfig.CLASS_PATH + "controller";		}
		 public String getType() {
			return "Action";		}
		 public String getFilePath() {
			return ASMConfig.BASE_PATH+ "main/java/"+ ASMConfig.CLASS_PATH + "action/@{entity_package_type_lower}@/"; }
		 public String getFileSuffix() { 
			return ".java";		}
		 public String getTmpFilePath() {
			return "conf/template/action.tmp";		}
		},

	DAO {
		 public String getClassPath() {
			return ASMConfig.CLASS_PATH + "dao";		}
		 public String getType() {
			return "Dao";		}	
		 public String getFilePath() {
			 return ASMConfig.BASE_PATH+ "main/java/"+ ASMConfig.CLASS_PATH + "dao/@{entity_package_type_lower}@/"; }
		 public String getFileSuffix() { 
			return ".java";		}	
		 public String getTmpFilePath() {
			return "conf/template/dao.tmp";		}
		},

	SERVICE {
		 public String getClassPath() {
			return ASMConfig.CLASS_PATH + "service";		}
		 public String getType() {
			return "Service";		}	
		 public String getFileSuffix() {
			return ".java";		}	
		 public String getFilePath() {
			 return ASMConfig.BASE_PATH+ "main/java/"+ ASMConfig.CLASS_PATH + "service/@{entity_package_type_lower}@/"; }
		 public String getTmpFilePath() {
			return "conf/template/service.tmp";		}
			},

	DAO_IMPL {
		 public String getClassPath() {
			return ASMConfig.CLASS_PATH + "dao.impl";		}
		 public String getType() {
			return "DaoImpl";		}	
		 public String getFilePath() {
			 return ASMConfig.BASE_PATH+ "main/java/"+ ASMConfig.CLASS_PATH + "dao/@{entity_package_type_lower}@/impl/"; }
		 public String getFileSuffix() { 
			return ".java";		}	
		 public String getTmpFilePath() {
			return "conf/template/daoImpl.tmp";		}
	},

	SERVICE_IMPL {
		 public String getClassPath() {
			return ASMConfig.CLASS_PATH + "service";		}
		 public String getType() {
			return "ServiceImpl";		}	
		 public String getFileSuffix() {
			return ".java";		}	
		 public String getFilePath() {
			 return ASMConfig.BASE_PATH+ "main/java/"+ ASMConfig.CLASS_PATH + "service/@{entity_package_type_lower}@/impl/"; }
		 public String getTmpFilePath() {
			return "conf/template/serviceImpl.tmp";		}
	},
						
	ENTITY {
		 public String getClassPath() {
			return ASMConfig.CLASS_PATH + "entity";		}
		 public String getType() {
			return "";		}	
		 public String getFileSuffix() {
			return ".java";		}	
		 public String getFilePath() {
			 return ASMConfig.BASE_PATH+ "main/java/"+ ASMConfig.CLASS_PATH + "entity/@{entity_package_type_lower}@/"; }
		 public String getTmpFilePath() {
			return "conf/template/entity.tmp";		}
	},			
			
	JS {
		 public String getClassPath() {
			return "";		}
		 public String getFileSuffix() {
			return ".js";		}	
		 public String getType() {
			return "index";		}	
		 public String getFilePath() {
			 return ASMConfig.BASE_PATH+ "main/webapp/" + ASMConfig.BASE_JAP_PATH + "@{entity_package_type_lower}@/@{entity_name_lower_all}@/js/"; }
		 public String getTmpFilePath() {
			return "conf/template/indexJs.tmp";		}
			},			
	JS_ADD_OR_EDIT { // fileName = tb.getEntityName() + type.getType() + type.getFileSuffix();
		public String getClassPath() {
			return "";		}
		public String getFileSuffix() {
			return ".js";		}	
		public String getType() {
			return "addOrEdit";		}	
		public String getFilePath() {
			return ASMConfig.BASE_PATH+ "main/webapp/" + ASMConfig.BASE_JAP_PATH + "@{entity_package_type_lower}@/@{entity_name_lower_all}@/js/"; }
		public String getTmpFilePath() {
			return "conf/template/addOrEditJs.tmp";		}
	},			
	
	JSP {
		 public String getClassPath() {
			return "";		}
		 public String getFileSuffix() {
			return ".jsp";		}	
		 public String getType() {
			return "index";		}
		 public String getFilePath() {
			return ASMConfig.BASE_PATH+ "main/webapp/" + ASMConfig.BASE_JAP_PATH + "@{entity_package_type_lower}@/@{entity_name_lower_all}@/"; }
		 public String getTmpFilePath() {
			return "conf/template/indexJsp.tmp";		}
		},			
		
	JSP_ADD_OR_EDIT { //  fileName = tb.getEntityName() + type.getType() + type.getFileSuffix();
		public String getClassPath() {
			return "";		}
		public String getFileSuffix() {
			return ".jsp";		}	
		public String getType() {
			return "addOrEdit";		}
		public String getFilePath() {
			return ASMConfig.BASE_PATH+ "main/webapp/" + ASMConfig.BASE_JAP_PATH + "@{entity_package_type_lower}@/@{entity_name_lower_all}@/"; }
		public String getTmpFilePath() {
			return "conf/template/addOrEditJsp.tmp";		}
	},			

}
